<script type="text/javascript" src="/scripts/utilities.js"></script>
		<div class="PhoVidCrtForm">
		<form enctype="multipart/form-data" id="messageform" name="messageform" method="POST" action="/album/index/photo-share/<?php echo base64_encode($ctx->album_id).'/'.base64_encode($ctx->photo_id) ; ?>" >
		<div class="pad_t8">
		<?php 
		//echo '<pre>';print_r($ctx->groups_details);exit;
			if(isset($ctx->groups_details['album_id'])!="")
			{
				$eventName = $ctx->groups_details['eventName'];
				$event_id = $ctx->groups_details['event_id'];
			}
			else
			{
				
				$eventName = "";
				$event_id = "";
			}
		?>
		<label>Event</label>
		<select style="width:445px;" id="event" name="event">
				<option value="0" >Link to Existing Event</option>
				<?php 
				$i=0;
				while($i<count($ctx->events))
				{ ?>
				<?php if($ctx->events[$i]['event_id'] == $event_id) { ?>
				<option value="<?php echo $ctx->events[$i]['event_id']; ?>" selected="selected"><?php echo $eventName; ?></option>
				<?php } else { ?>
				<option value="<?php echo $ctx->events[$i]['event_id']; ?>"><?php echo $ctx->events[$i]['text']; ?></option>  
				<?php } ?>
				<?php $i++; }?>
		</select>
		
		<div class="clear"></div>
		</div>
		<div class="pad_t8">
		<label>&nbsp;</label>
		<div class="Fleft">
		<input type="radio" name="radio" value ="group" style="width:30px;" onchange="showGroups(this)"/>Group
		</div>
		<div class="Fleft">
		<input type="radio" name="radio" value ="public" style="width:30px;" checked="checked" onchange="showGroups(this)"/>Public
		</div>
		<div class="clear"></div>
		</div>
		<div class="pad_t8" id="divx">
		<div class="clear"></div>
		</div>
		<div class="clear"></div>
       	<div class="pad_t8">
		<label>&nbsp;</label>
		<a class="Button" href="javascript:void(0);" onclick="create(document.messageform);"><span>Share</span></a>
		<div class="clear"></div>
		</div>
	</form>
	</div>
<script>
//<![CDATA[

function create(frm)
{

		$('#messageform').submit();

	//alert(result);
	//return result;
}
function showGroups(obj)
{
	//alert(obj.value);return false;
	if(obj.value == "group")
	document.getElementById('divx').innerHTML = '<div><label>Select Group</div></label><select id="group" name="group[]" class="medium" size=4 multiple><option value="0" >--- Options ---</option><?php $i=0;while($i<($ctx->count)){ ?><option value="<?php echo $ctx->groups[$i]['group_id']; ?>"><?php echo $ctx->groups[$i]['name']; ?></option><?php $i++; }?></select>';
	
	else  document.getElementById('divx').innerHTML='';

}
//]]>
</script>
